<script setup lang="ts">
import { ref } from "vue";
import  CounterComp  from "@/components/CounterComp.vue";
import MyComp from "@/components/MyComp.vue";
let count = ref<number>(0);
const myComp = ref<InstanceType<typeof MyComp> | null>(null);
const title = ref("计算器");
// const change = (val: number) => {
//   count.value = val;
// };

const openModal = () => {
  myComp.value?.toggleShown(); 
};


</script>

<template>
  <div>
    <button @click="openModal">点击显示/隐藏</button>
    <MyComp ref="myComp" />
    
    <!-- <CounterComp :count="count" :title="title" @change="change"  /> -->
    <CounterComp v-model:count="count" v-model:title="title"  />
  </div>
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
